package org.jsbd.boss.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jsbd.boss.common.DataGridModel;
import org.jsbd.boss.dao.IRetentStatisticsDao;
import org.jsbd.boss.domian.ChannelRetentLogInfo;
import org.jsbd.boss.domian.RetentStatisticsBean;
import org.jsbd.boss.domian.TaskHandlerSh;
import org.jsbd.boss.domian.UserUpgradeVo;
import org.jsbd.boss.domian.statistics.ImsiretentResultVo;
import org.springframework.stereotype.Repository;

@Repository("retentStatisticsDao")
public class RetentStatisticsDaoImpl extends CrackBaseDao implements IRetentStatisticsDao {

	@Override
	public void saveRetentTotalNumInfo(List<RetentStatisticsBean> statisticsList) {
		super.batchUpdate("qy_channel_retent_statistics.update_qy_channel_retent_statistics_totalNum",
				statisticsList);
	}

	@Override
	public List<RetentStatisticsBean> getRetentTotalNumInfoList(String startDay) {
		return super.queryForList("qy_channel_retent_statistics.get_retent_total_info",startDay);
	}

	
	@Override
	public Map<String, Object> getRetentTaskPageList(DataGridModel page, TaskHandlerSh form) {
		form = (form == null ? new TaskHandlerSh() : form);
		form.setPageInfo(page);
		Map<String, Object> results = new HashMap<String, Object>();
		results.put("total", super.queryForCount("qy_channel_retent_statistics.select_qy_channel_retent_statistics_page_count", form));
		results.put("rows", super.queryForList("qy_channel_retent_statistics.select_qy_channel_retent_statistics_list", form));
		return results;
	}

	@Override
	public void updateByMarkAndRd(List<ImsiretentResultVo> imsiretentResultVo) {
		super.batchUpdate("qy_channel_retent_statistics.update_qy_channel_retent_statistics_calibrationNum", imsiretentResultVo);
	}

	@Override
	public List<UserUpgradeVo> selectUnUpgrageList(UserUpgradeVo userUpgradeVo) {
		return super.queryForList("qy_channel_retent_statistics.select_unupgrage_list", userUpgradeVo);
	}

	@Override
	public Integer selectUnUpgrageListCount(UserUpgradeVo userUpgradeVo) {
		return super.queryForCount("qy_channel_retent_statistics.select_unupgrage_list_count", userUpgradeVo);
	}

}
